package com.kaili.db.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.kaili.common.exception.BaseExcept;
import com.kaili.db.mapper.HsEwbsDispatchDetailMapper;
import com.kaili.db.service.IHsEwbsDispatchDetailService;
import com.kaili.pojo.entity.HsEwbsDispatchDetail;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author cgm
 * @since 2018-05-08
 */
@Service
public class HsEwbsDispatchDetailServiceImpl extends ServiceImpl<HsEwbsDispatchDetailMapper, HsEwbsDispatchDetail> implements IHsEwbsDispatchDetailService {


    public boolean insertBatch(List<HsEwbsDispatchDetail> list){
        baseMapper.insertBatch(list);
        return true;
    }

    public  List<HsEwbsDispatchDetail> queryEwbDispatchDetail(Map<String, Object> search)throws BaseExcept{

        return baseMapper.queryEwbDispatchDetail(search);
    }

    @Override
    public boolean isDispatchOrSign(Map<String, Object> search) throws BaseExcept {
        Integer count = baseMapper.queryDispatchOrSignCount(search);
        if(count>0){
            return true;
        }

        return false;
    }
}
